<?php
/**
 * 描述：本网动态。
 * @final
 */
final class Exec_Trends_List
{
    public function __construct()
    {

        #获取数据-动态列表
        $data=DB::GetData('select * from news where ClassID='.DAO_NewsClass::Trends_ID.' and M_IsDelete=FALSE order by ID desc limit ?,20');
        View::Assign('Trends',@$data['Record']);
        View::Assign('Trends_PageMenu',PagerFactory::Create('Common')->Fetch($data,array
        (
            'URL'=>'/exec.php?action=trends_list',
            'IsDetail'=>TRUE,
            'Rewriter'=>new PagerRewrite('/dynamic/','','html')
        )));

        #获取数据-图片形式列表
        $data=DB::GetRows('select * from news where ClassID='.DAO_NewsClass::Trends_ID.' and (Thumbnail<>"" and Thumbnail is not NULL) and M_IsDelete=FALSE order by ID desc limit 0,3');
        foreach($data as &$row)
        {
            $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
        }
        View::Assign('Trends_HavePicture',$data);

        View::Display('trends/list.tpl');
    }
}
?>